using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LihuaCtrl : MonoBehaviour
{
    public Animator animator;

    private void Start()
    {
        animator = gameObject.GetComponent<Animator>();
        BdPackage.BdUtils.assert(animator != null);
    }

    public void btn_conv_to_state(string state_name = "stop")
    {
        if (!gameObject.GetComponent<LihuaCtrl>().enabled)
            return;
        BdPackage.BdUtils.log("state_name:", state_name);
        BdPackage.BdUtils.assert(BdTools.has_animation_state(animator, state_name), $"`animator`没有`state_name[{state_name}]`?");
        animator.Play(state_name);
    }
}
